package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.FriendsLinksMapper;
import com.aidex.biz.domain.FriendsLinks;
import com.aidex.biz.service.FriendsLinksService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 友情小程序链接Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2022-10-21
 */
@Service
@Transactional(readOnly = true)
public class FriendsLinksServiceImpl extends BaseServiceImpl<FriendsLinksMapper, FriendsLinks> implements FriendsLinksService
{
    private static final Logger log = LoggerFactory.getLogger(FriendsLinksServiceImpl.class);

    /**
     * 获取单条数据
     * @param friendsLinks 友情小程序链接
     * @return 友情小程序链接
     */
    @Override
    public FriendsLinks get(FriendsLinks friendsLinks)
    {
        FriendsLinks dto = super.get(friendsLinks);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 友情小程序链接id
     * @return 友情小程序链接
     */
    @Override
    public FriendsLinks get(String id)
    {
        FriendsLinks dto = super.get(id);
        return dto;
    }


    /**
     * 查询友情小程序链接列表
     * @param friendsLinks 友情小程序链接
     * @return 友情小程序链接
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<FriendsLinks> findList(FriendsLinks friendsLinks)
    {
        return super.findList(friendsLinks);
    }

    /**
     * 分页查询友情小程序链接列表
     * @param friendsLinks 友情小程序链接
     * @return 友情小程序链接
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<FriendsLinks> findPage(FriendsLinks friendsLinks)
    {
        return super.findPage(friendsLinks);
    }

    /**
     * 保存友情小程序链接
     * @param friendsLinks
     * @return 结果
     */
    @Override
    public boolean save(FriendsLinks friendsLinks)
    {
        return super.save(friendsLinks);
    }


    /**
     * 删除友情小程序链接信息
     * @param friendsLinks
     * @return 结果
     */
    @Override
    public boolean remove(FriendsLinks friendsLinks)
    {
        return super.remove(friendsLinks);
    }

    /**
     * 批量删除友情小程序链接
     * @param ids 需要删除的友情小程序链接ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteFriendsLinksByIds(String[] ids)
    {
        return mapper.deleteFriendsLinksByIds(ids);
    }

    /**
     * 获取最大编号
     * @param friendsLinks 友情小程序链接
     * @return 结果
     */
    @Override
    public int findMaxSort(FriendsLinks friendsLinks)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(friendsLinks));
    }
}
